package com.tocea.formation.users.library.rent;

import java.util.Date;

import com.insta.archilog.dal.BookRequest;
import com.insta.archilog.dal.RentRequest;
import com.tocea.formation.library.IBook;
import com.tocea.formation.users.IUser;


public class Rent implements IRentBook
{
    
    private IUser user;
    private IBook book;
    private Date startDate;
    private boolean isReturn;
    private Date returnDate;
    private long id;
    private RentRequest RentR =  new RentRequest();
    
    public Rent(IUser user, IBook book, long _id) {
    
        super();
        this.user = user;
        this.book = book;

       startDate = new Date();
       isReturn = false;
       id = _id;
    }

    public IUser getUser() {
    
        return user;
    }
    
    public IBook getBook() {
    
        return book;
    }
    
    public Date getStartDate() {
    
        return startDate;
    }


    public boolean isReturn() {
    
        return isReturn;
    }

    public Date getReturnDate() {
    
        return returnDate;
    }

    public void setreturnDate(Date _returnDate) {
    
        returnDate = _returnDate;
        isReturn = true;
        RentR.returnBook(this.getId());
    }

    public long getId() {
        return id;
    }
    
}
